package dgo.tilemap;
import starruby.Texture;
public class PaletChip {
  MapChipset chipset;
  public int no;
  byte xCount, collisioniType, priority;
  private int _sx, _sy;
  public PaletChip(MapChipset chipset, int no, byte xCount, byte collisionType, byte priority){
    this.chipset = chipset;
    this.no = no;
    this.xCount = xCount;
    _sx = (no % xCount) * chipset.gridWidth;
    _sy = (no / xCount) * chipset.gridHeight;
    this.collisioniType = collisionType;
    this.priority = priority;
  }

  public void render(Texture s, int x, int y, int dx, int dy, int frameNo){
    s.renderTexture(chipset.texture, x * chipset.gridWidth - dx, y * chipset.gridHeight - dy, _sx, _sy, chipset.gridWidth, chipset.gridHeight);
  }
}
